package com.tdf.lolpanel.controller;

import com.tdf.lolpanel.constant.JwtConstant;
import com.tdf.lolpanel.constant.MsgConstant;
import com.tdf.lolpanel.constant.StatusConstant;
import com.tdf.lolpanel.context.BaseContext;
import com.tdf.lolpanel.dto.RoomRegisterDTO;
import com.tdf.lolpanel.entity.Room;
import com.tdf.lolpanel.result.Response;
import com.tdf.lolpanel.service.RoomService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/room")
@Tag(name = "房间相关接口")
@Slf4j
public class RoomController {

    @Autowired
    private RoomService roomService;

    /**
     * 添加房间
     */
    @PostMapping
    @Operation(summary = "新增房间")
    public Response add(@RequestBody RoomRegisterDTO roomRegisterDTO) {
        log.info("添加房间: {}", roomRegisterDTO);
        roomService.add(roomRegisterDTO);
        return Response.success();
    }
}
